<?php

class TopicsGroup extends AppModel {
    
    ////////////////////////
    public $hasMany = array (
        'UserTopicGroup' => array (
            'foreignKey' => 'topics_groups_id'
        ),
        'Action' => array(
            'foreignKey' => 'topics_groups_id'
        )
    );
    
    ////////////////////////
    public $HasAndBelongsToMany = array (
        'Tag' => array(
            'joinTable' => 'tags_topics_groups',
            'foreignKey' => 'topics_group_id',
            'associationForeignKey'  => 'tag_id'
            )
    );
    
    ////////////////////////
    var $validate = array(
        'name' => array(
            'between' => array(
                'rule' => array('between', 3, 255),
                'message' => 'Nom du groupe doit être compris entre 3 et 255 caractères'
            ))
        );
}
?>
